package com.itheima.in;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;

public class Demo04 {

    public static void main(String[] args) throws IOException {

        FileInputStream fis = new FileInputStream("day12\\b.txt");
       /* while (true) {
            byte[] bytes = new byte[10];

            int length = fis.read(bytes);
            System.out.println("读到了" + length + "个数据");
            System.out.println(Arrays.toString(bytes));
            if (length == -1) {
                break;
            }
        }*/
        byte[] bytes = new byte[10];
        int length;
        while ((length=fis.read(bytes))!=-1){
            System.out.println("读到了" + length + "个数据");
            System.out.println(Arrays.toString(bytes));
        }

        fis.close();

    }
}
